Communications 105

After the reader presses the button below, I'll ask if he or she wants to say hello. If so, I'll say hello with an alert.

Discussion

This fifth "hello" program uses the confirm dialog to check if the reader wishes a greeting.

Using confirm

if (confirm("Say Hello?"))
alert("Hello World!")
Copyright ©1998 by Charles River Media, All Rights Reserved